from PIL import Image
import os

def crop_image(image, name):
    img = Image.open(image)
    width, height = img.size
    
    box = (0, 0, width, height-50)
    area = img.crop(box)
    
    area.convert('RGB').save(name, 'jpeg')


path="/home/stefanie/workspace/Gel image analyse/Gel images/"  # insert the path to the directory of interest

dirList=os.listdir(path)
for fname in dirList:
    
    if fname.endswith('.tif'):
        crop_image(path + fname, fname + '.jpg')
   